package com.frame.util;

import java.util.regex.Pattern;

import org.apache.commons.lang.StringUtils;

public class DataVerify {

	private static Pattern mp =Pattern.compile("^[1][3,4,5,8][0-9]{9}$");
	private static Pattern pp=Pattern.compile("1([\\d]{10})|((\\+[0-9]{2,4})?\\(?[0-9]+\\)?-?)?[0-9]{7,8}");

	/**
	 *
	 * 功能:验证手机号<br>
	 * 参数:<br>
	 * 作者:王海锋<br>
	 * 时间:2016-5-19下午02:50:20<br>
	 */
	public static boolean isMobile(String m){
		if(StringUtils.isBlank(m))return false;
		return mp.matcher(m).matches();
	}
	public static boolean isPhone(String p) {
		if(StringUtils.isBlank(p))return false;
		return pp.matcher(p).matches();
	}
}
